<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        

        
// arguments
    //    function adim(){
    //     console.log(arguments);//里面存储了所有传递过来的值
    //    }
    //    adim(1,2,34,5,5) 
    //    arguments
    //    具有length属性
    //    按照索引方式进行存储





    function a(){
        var max =arguments[0];
        for(var i=1;i<=arguments.length;i++){
            if(arguments[i]>max){
                max=arguments[i];
            }
        }
        return max;
    }
    console.log(a(11,2,3,4,33,21,5,66,99));



//冒泡
    function arr(ars){
        for(var i=0;i<=ars.length-1;i++){
            for(var j=0;j<=ars.length-i-1;j++){
                 if(ars[j]>ars[j+1]){
                 var  temp=ars[j]
                    ars[j]=ars[j+1]
                    ars[j+1]=temp
                 }
            } 
         }return ars;
        
    }
    var ars1=arr([7,2,4,1,3,5,8,6]);
console.log(ars1);
    </script>
</body>
</html>